package top.xianggg.xservers.sys.repository;

import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
import top.xianggg.xservers.sys.entity.SysUser;

import java.util.Optional;

/**
 * @author Jr.November
 */
@RepositoryRestResource
public interface SysUserRepository extends PagingAndSortingRepository<SysUser, Long> {

    /**
     * 通过username查找用户
     * @param username 用户名
     * @return 用户实例,可能为空
     */
    Optional<SysUser> findByUsername(String username);
}
